*** Set working directory ***
cd "C:\..."

*********************** Load Data **********************************************
clear
graph drop _all
cap drop all

use Firm_Level

************************** Setup ***********************************************
sort date

* Merge & Standardize Quarterly MP Shock series
merge m:1 date using fomc_GSW_yields_qtr
drop if _merge != 3
drop _merge
egen mps_std = sd(chg_sveny02)
gen mps = chg_sveny02/mps_std

sort gvkey date
xtset gvkey date

replace invest = invest*100 

***************************** Regressions **************************************
gen gscpi_mps = L.gscpi*mps
gen gscpi_size = L.gscpi*L.size
gen mps_size = mps*L.size
gen gscpi_mps_size = L.gscpi*mps*L.size
gen gscpi_age = L.gscpi*L.age
gen mps_age = mps*L.age
gen gscpi_mps_age = L.gscpi*mps*L.age

reghdfe invest mps L.gscpi gscpi_mps mps_age gscpi_age gscpi_mps_age L.current L.salesg L.size L.ptoc L.rmptos L.dtoa L.age L.cap L.levg L.lqdty, absorb(gvkey date) cluster(gvkey)
outreg2 using "table5.xml", replace se bdec(3) bracket label  
reghdfe invest mps L.gscpi gscpi_mps mps_size gscpi_size gscpi_mps_size L.current L.salesg L.size L.ptoc L.rmptos L.dtoa L.age L.cap L.levg L.lqdty, absorb(gvkey date) cluster(gvkey)
outreg2 using "table5.xml", append se bdec(3) bracket label  


********************************************************************************